// with polyfills
import 'core-js/stable'
import 'regenerator-runtime/runtime'

import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store/'
import i18n from './locales'
import { VueAxios } from './utils/request'
import ProLayout, { PageHeaderWrapper } from '@ant-design-vue/pro-layout'
import themePluginConfig from '../config/themePluginConfig'
import { Icon, Tree, Cascader, Collapse, Transfer, Empty, Anchor, Calendar, Pagination, affix } from 'ant-design-vue'
// import ImageShow from './components/tools/ImageShow'
import TabsView from './layouts/TabsView.vue'
// mock
// WARNING: `mockjs` NOT SUPPORT `IE` PLEASE DO NOT USE IN `production` ENV.
// import './mock'

import bootstrap from './core/bootstrap'
import './core/lazy_use' // use lazy load components
// import './permission' // permission control
import './utils/filter' // global filter
import './global.less' // global style

Vue.config.productionTip = false

const IconFont = Icon.createFromIconfontCN({
  scriptUrl: '//at.alicdn.com/t/c/font_4311022_nina9jx6yk.js'
})
const { Link } = Anchor

// mount axios to `Vue.$http` and `this.$http`
Vue.use(VueAxios)
// use pro-layout components
Vue.component('pro-layout', ProLayout)
Vue.component('page-header-wrapper', PageHeaderWrapper)
Vue.component('a-tree', Tree)
Vue.component('a-cascader', Cascader)
Vue.component('a-transfer', Transfer)
Vue.component('a-empty', Empty)
Vue.component('a-anchor', Anchor)
Vue.component('a-anchor-link', Link)
Vue.component('a-calendar', Calendar)
Vue.component('a-pagination', Pagination)
Vue.component('a-affix', affix)
// Vue.component('image-show', ImageShow)
Vue.component('tabs-view', TabsView)

Vue.component('icon-font', IconFont)

Vue.use(Collapse)

window.umi_plugin_ant_themeVar = themePluginConfig.theme

new Vue({
  router,
  store,
  i18n,
  // init localstorage, vuex, Logo message
  created: bootstrap,
  render: h => h(App)
}).$mount('#app')
